#include<bits/stdc++.h>
using namespace std;
int T,n,m,a[1000010],q[1000010],p;
void dfs(int x){
	if(x==p){
		t[x]=(x<=n?x:-1);
		w[x]=a[p*2-x];
		return ;
	}
	int ls=x*2+1,rs=x*2;
	dfs(ls,d-1),dfs(rs,d-1);
	if(d[x]==1) swap(ls,rs);
	if(t[ts]==-1) t[x]=1;w[x]=0;
	else if(t[ts]>=d) t[x]=t[ls];w[x]=w[rs];
	else t[x]=t[rs];w[x]=w[rs];
}
void dfs2(int x,int d,int mi){
	if(x>=p){
		int v=p*2-x;
	}
	int ls=x*2-1;rs=x*2;
	dfs2(ls,d-1,mi);
	if(d[x]==1) dfs2(rs,d-1,mi);
	else dfs2(rs,d-1,min(mi,t[ls]-1));
}
void dfs3(int x,int d,int mi,int mx){
	if(x==p){
		int v=p*2-x;
		if(a[v]<mx) return ;
		if(v<=mi-1) upd(v,mi-1,1);
		return ;
	}
	int ls=x*2-1,rs=x*2;
	if(d[x]==0){
		dfs3(ls,d-1,mi,max(mx.d));
	}
}
int main(){
	freopen("arena.in","r",stdin);
	freopen("arena.out","w",stdout);
	cin>>n>>m;
	for(int i=1;i<=n;i++) cin>>a[i];
	for(int i=1;i<=m;i++) cin>>q[i];
	int p=1;
	for(int i=p;i>=1;i--){
		char ch;
		cin>>ch;
		q[i]=ch-'0';
	}
	cin>>T;
	while(T--){
		cin>>x[0]>>x[1]>>x[2]>>x[3];
		for(int i=1;i<=n;i++) a[i]=a2[i]^(1%4);
	}
	cout<<5<<endl;
	cout<<19<<endl;
	cout<<7<<endl;
	cout<<1<<endl;
	return 0;
}
